﻿using UnityEngine;
using System.Collections;

public class CompletedLevelScript : MonoBehaviour {

	public int timeUntilNextLevelLoads = 120;
	public AudioClip[] Audio;
	private int _counter = 0;

	// Update is called once per frame
	void Update () {
		if (_counter == 0) {
			AudioSource.PlayClipAtPoint(Audio[0], transform.position);
		}

		if(_counter++ > timeUntilNextLevelLoads)
		{

				GotoNextLevel();
		}
	}

	public void GotoNextLevel()
	{

		//gameObject.Find("LevelController").GetComponent<LevelController>().LoadNextLevel();
	}
}
